/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/07/11
* File: OGLTexture2D.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef OGLTexture2D_h__
#define OGLTexture2D_h__

#include "../../Core/Core.h"
#include "../../Core/Declare.h"
#include "../Texture.h"

class OGLTexture2D : public Texture
{
public:
	OGLTexture2D();
	OGLTexture2D(const std::string& path, bool is_mipmap);

	~OGLTexture2D();

	bool createTexture();
	bool destroyTexture();

	void setPath(const std::string& path);
	void setMipmap(bool is_mipmap);

	const std::string& getPath() const;
	bool isMipmap() const;
	TextureType getTextureType() const;

	bool saveTexture(const std::string& path);

	s32 getTextureWidth() const;
	s32 getTextureHeight() const;

	GLuint getTextureID() const;

	void active(s32 index);

protected:
	GLuint				_handle;
	s32					_width;
	s32					_height;
};
#endif    /* OGLTexture2D_h__ */